home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / lfs / lfsSegUsageInt.h < prev    next >
C/C++ Source or Header  |  1991-06-29  |  3KB  |  78 lines

  1. /*
  2.  * lfsSegUsageInt.h --
  3.  *
  4.  *    Declarations of LFS segment ussage routines and data structures
  5.  *    private to the Lfs module.
  6.  *
  7.  * Copyright 1989 Regents of the University of California
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  *
  16.  * $Header: /sprite/src/kernel/lfs/RCS/lfsSegUsageInt.h,v 1.7 91/06/29 17:04:50 mendel Exp $ SPRITE (Berkeley)
  17.  */
  18.  
  19. #ifndef _LFSSEGUSAGEINT
  20. #define _LFSSEGUSAGEINT
  21.  
  22. #include <lfsUsageArray.h>
  23.  
  24. /* constants */
  25.  
  26. /* data structures */
  27.  
  28. typedef struct LfsSegUsage {
  29.     LfsStableMem    stableMem;/* Stable memory supporting the map. */
  30.     LfsSegUsageParams    params;      /* Map parameters taken from super block. */
  31.     LfsSegUsageCheckPoint checkPoint; /* Desc map data written at checkpoint. */
  32.     int            timeOfLastWrite; /* Time of last write of current
  33.                       * segment. */
  34. } LfsSegUsage;
  35.  
  36. typedef struct LfsSegList {
  37.     int    segNumber;    /* Segment number of segment. */
  38.     int activeBytes;    /* Active bytes from the seg usage array. */
  39.     unsigned int priority;    /* Priority for the space-time sorting. */
  40. } LfsSegList;
  41.  
  42. /* procedures */
  43.  
  44. extern void LfsSegUsageInit _ARGS_((void));
  45.  
  46. extern void LfsSetSegUsage _ARGS_((struct Lfs *lfsPtr, int segNumber, 
  47.             int activeBytes));
  48. extern ReturnStatus LfsGetLogTail _ARGS_((struct Lfs *lfsPtr, Boolean cantWait,
  49.             LfsSegLogRange *logRangePtr, int *startBlockPtr ));
  50.  
  51. extern void LfsSetLogTail _ARGS_((struct Lfs *lfsPtr, 
  52.             LfsSegLogRange *logRangePtr, int startBlock, 
  53.             int activeBytes, int timeOfLastWrite));
  54.  
  55. extern void LfsMarkSegsClean _ARGS_((struct Lfs *lfsPtr, int numSegs, 
  56.                 LfsSegList  *segs));
  57. extern void LfsSetDirtyLevel _ARGS_((struct Lfs *lfsPtr, int dirtyActiveBytes));
  58.  
  59. extern int LfsGetSegsToClean _ARGS_((struct Lfs *lfsPtr, 
  60.             int maxSegArrayLen, LfsSegList *segArrayPtr, 
  61.             int *minNeededToCleanPtr, int *maxAvailToWritePtr));
  62.  
  63. extern ReturnStatus LfsSegUsageFreeBlocks _ARGS_((struct Lfs *lfsPtr, 
  64.             int blockSize, int blockArrayLen, 
  65.             LfsDiskAddr *blockArrayPtr));
  66. extern ReturnStatus LfsSegUsageAllocateBytes _ARGS_((struct Lfs *lfsPtr,                 int numBytes));
  67. extern ReturnStatus LfsSegUsageFreeBytes _ARGS_((struct Lfs *lfsPtr, 
  68.             int numBytes));
  69.  
  70. extern void LfsSegUsageCheckpointUpdate _ARGS_((struct Lfs *lfsPtr,
  71.             char *checkPointPtr, int size));
  72.  
  73. extern Boolean LfsSegUsageEnoughClean _ARGS_((struct Lfs *lfsPtr,
  74.                 int dirtyBytes));
  75.  
  76. #endif /* _LFSSEGUSAGEINT */
  77.  
  78.